package com.beamfield.dao.material;

import java.util.List;

import com.beamfield.modelVo.OutboundEmbedVo;
import com.beamfield.modelVo.OutboundRebarVo;
import com.beamfield.modelVo.SuppliesStatisticsVo;
import org.apache.ibatis.annotations.Param;

import com.beamfield.model.Inbound;
import com.beamfield.model.InboundExample;
import org.springframework.stereotype.Component;

@Component
public interface InboundMapper {
    int deleteByPrimaryKey(Long inbound_id);

    int insert(Inbound record);

    int insertSelective(Inbound record);

    List<Inbound> selectByExample(InboundExample example);

    Inbound selectByPrimaryKey(Long inbound_id);

    int updateByPrimaryKeySelective(Inbound record);

    int updateByPrimaryKey(Inbound record);

    List<Inbound> selectBySuppliesId(@Param("suppliesId") String suppliesid,
    		@Param("planId") Long planid,
    		@Param("beamId") Long beamid,
    		@Param("manufacturer") String manufacturer);

    List<Inbound> selectBySuppliesIdDistinct(@Param("suppliesId") String suppliesid,
    		@Param("planId") Long planid,
    		@Param("beamId") Long beamid,
    		@Param("keywords") String keywords,
    		@Param("offset")Integer offset,
    		@Param("limit")Integer limit);
    List<Inbound> selectBySuppliesIdNotDistinct(@Param("suppliesId") String suppliesid,
    		@Param("planId") Long planid,
    		@Param("beamId") Long beamid,
    		@Param("keywords") String keywords,
    		@Param("offset")Integer offset,
    		@Param("limit")Integer limit);

    List<OutboundRebarVo> getRebarData(@Param("suppliesId") String suppliesId, @Param("projectId") String projectId, @Param("purchasePlanId") String purchasePlanId, @Param("beamId") Long beamId);

    List<OutboundEmbedVo> getEmbedData(@Param("suppliesId") String suppliesId,@Param("projectId") String projectId,@Param("purchasePlanId") String purchasePlanId);

    List<Inbound> selectByProjectIdAndSuppliesId(@Param("projectId") String projectId,@Param("suppliesId") String suppliesId, @Param("type") String type, @Param("projectDetailId") String projectDetailId);

    List<SuppliesStatisticsVo> selectByBeamId(@Param("beamId") Long beamId);

    List<Inbound> selectBySuppliesNameAndModel(@Param("suppliesName") String suppliesName, @Param("suppliesModel") String suppliesModel,@Param("beamId") long beamId);

    List<Inbound> selectNotOutByProjectIdAndSuppliesId(@Param("projectId") Long projectId,@Param("suppliesId") String suppliesId);

    Double getInboundSum(@Param("suppliesId")String suppliesId,@Param("beamId") Long beamId);

    List<Inbound> selectBySupIdAndProjectId(@Param("suppliesId") String suppliesId, @Param("projectId") Long projectId,@Param("type") String type);

    /**
     * 查询入库合格记录
     * @param suppliesId
     * @return
     */
    List<Inbound> selectBySuppliesId2(@Param("suppliesId") String suppliesId);

    List<Inbound> selectBySuppliesType(@Param("list") List<String> supTypeList,@Param("beamId") Long beamId);
}
